﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Main.aspx.cs" Inherits="SimpleWebChat.Main" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Web chat</title>
    <link rel="Stylesheet" type="text/css" href="Site.css" />
</head>
<body>
    <form id="mainForm" runat="server">
    <asp:ScriptManager runat="server" />
    <asp:Timer ID="reloadTimer" runat="server" Interval="100">
    </asp:Timer>
        <asp:UpdatePanel ID="mainUP" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <div id="comment">
                    <asp:TextBox ID="commentTxt" runat="server"></asp:TextBox>
                    <asp:Button ID="sendBtn" runat="server" Text="Send" onclick="sendBtn_Click"/>
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
        <asp:UpdatePanel ID="commentsUP" runat="server" UpdateMode="Conditional">
            <Triggers>
                <asp:AsyncPostBackTrigger   ControlID="reloadTimer" EventName="Tick" />
            </Triggers>
            <ContentTemplate>
                <asp:Repeater ID="commentsRepeater" runat="server">
                    <HeaderTemplate><h4>Last One Hundred Messages:</h4></HeaderTemplate>
                    <ItemTemplate>
                        <p>This message was posted on: <%# Eval("PostDate") %>
                        </p>
                        <%# Eval("Message1") %>
                    </ItemTemplate>
                </asp:Repeater>
            </ContentTemplate>
        </asp:UpdatePanel>
    </form>
</body>
</html>
